﻿using Easy.Domain.Abstractions;
using System;
using System.Collections.Generic;
using System.Text;

namespace Easy.Domain.OrderAggregate
{
    public class Address:ValueObject
    {
        public String Street { get; set; }
        public String City { get; set; }
        public String ZipCode { get; private set; }

        public Address()
        {

        }

        public Address(string street,string city,string zipCode)
        {
            this.Street = street;
            this.City = city;
            this.ZipCode = ZipCode;
        }

        protected override IEnumerable<object> GetAtomicValues()
        {
            //Using a yield return statement to return each one element at a time
            yield return Street;
            yield return City;
            yield return ZipCode;
        }
    }
}
